broadway: Add div for container nodes
authorAlexander Larsson <alexl@redhat.com>
Wed, 29 Nov 2017 18:31:54 +0000 (19:31 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 30 Nov 2017 20:57:42 +0000 (21:57 +0100)
We need this so that all nodes have divs, otherwise diffing is going
to be very hard.

gdk/broadway/broadway.js

index acbd80d236c8b7a59f22f0ab9a98999bfe41bcaf..0f85c7aaf4d07ee5cafc0caaf674df364464dc0a 100644 (file)
@@ -459,10 +459,12 @@ SwapNodes.prototype.handle_node = function(parent, offset_x, offset_y)
 
     case 1: // CONTAINER
         {
+            var div = document.createElement('div');
             var len = this.decode_uint32();
             for (var i = 0; i < len; i++) {
-                this.handle_node(parent, offset_x, offset_y);
+                this.handle_node(div, offset_x, offset_y);
             }
+            parent.appendChild(div);
         }
         break;